package com.qianqu.lib_base.application;

import android.app.Application;
import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.launcher.ARouter;

/**
 * ${description}
 *
 * @author weiqiliu
 * @version 1.0 2018/6/25
 */
public class CustomApplication extends Application {

    private static CustomApplication instance;

    @Override
    public void onCreate() {
        super.onCreate();
        Log.e("lib_base:","create_application");
        instance = this;
        initRouter(this);
    }

    public static Context getInstance() {
        return instance;
    }

    private void initRouter(CustomApplication mApplication) {
        ARouter.openLog();
        //开启调试模式(如果在InstantRun模式下运行，必须开启调试模式！
        //线上版本需要关闭,否则有安全风险
        ARouter.openDebug();
        ARouter.init(mApplication);
    }
}
